import request from '@/config/axios'

export interface FiberOrderVO {
  id?: number
  fiberOrderNumber: string
  workOrder: string
  workOrderId: string
  totalCoreCount: number
  tightOuterCount: number
  tubeCount: number
  processMode: string
  status: string
  pushPullDefinition: string
  finishedQuantity: number
  createdAt?: Date
  createdBy?: string
  updatedAt?: Date
  updatedBy?: string
}

// 新增配纤单
export const createFiberOrder = (data: FiberOrderVO) => {
  return request.post({ url: '/opticore/fiber/order/create', data })
}

// 修改配纤单
export const updateFiberOrder = (data: FiberOrderVO) => {
  return request.put({ url: '/opticore/fiber/order/update', data })
}

// 删除配纤单
export const deleteFiberOrder = (id: number) => {
  return request.delete({ url: '/opticore/fiber/order/delete?id=' + id })
}

// 获取配纤单详情
export const getFiberOrder = (id: number) => {
  return request.get({ url: '/opticore/fiber/order/get?id=' + id })
}

// 获取配纤单列表
export const getFiberOrderList = () => {
  return request.post({ url: '/opticore/infra/fiberOrder/pageFiberOrder' })
}
